﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ChooseProductCategory.ascx.cs" Inherits="HCFramework.Product.CategoryManage.ChooseProductCategory" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadComboBox ID="RadComboBox1" runat="server" Height="300px" CollapseDelay="0" ExpandDelay="0" CollapseAnimation-Duration="0" ExpandAnimation-Duration="0" AllowCustomText="False">
    <ItemTemplate>
        <telerik:RadTreeView ID="RadTreeView1" DataFieldParentID="ParentID" DataFieldID="ProductCategoryID"
            DataTextField="Name" DataValueField="ProductCategoryID" runat="server" CollapseAnimation-Duration="0" ExpandAnimation-Duration="0">
        </telerik:RadTreeView>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="" />
    </Items>
</telerik:RadComboBox>
<script type="text/javascript">
    $(document).ready(function () {
        $(<%="'#"+RadComboBox1.ClientID+"'" %> + " span.rtIn").click(function () {
            if(<%=OnlySelectLeafNode.ToString().ToLower() %> && !$(this).hasClass("leafNode")) return false;
            var comboInput = $(<%="'#"+RadComboBox1.ClientID+"'" %> + "_Input");
            comboInput.val($(this).html());
        });
    });
</script>